package etnorservice.etnor_service.mapper;

import etnorservice.etnor_service.domain.po.BlogLinks;
import etnorservice.etnor_service.domain.po.BaseArticle;
import etnorservice.etnor_service.domain.po.BlogTag;
import etnorservice.etnor_service.domain.po.BlogVisibility;
import etnorservice.etnor_service.domain.po.DocumentSpace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.method.P;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2024/10/14/17:24
 **/
@Mapper
public interface ArticleMapper {
    List<BaseArticle> findArticleList();
    BaseArticle findArticleById(@Param("articleId") String articleId,@Param("language") String language);
    void updateArticle(BaseArticle article);
    List<BaseArticle>findArticleByIdAndAccount(@Param("authorId") String authorId,@Param("spaceId") String spaceId);
    DocumentSpace findDocumentSpaceById(@Param("spaceId") String spaceId);
    List<BlogTag> findAllTags();
    List<BlogVisibility> findVisibilities();
    List<BlogLinks> findBlogLinks(@Param("account") String account);

    //新增博客
    //1.新增博客的版权
    void addBlogCopiright(@Param("copyright") String copyright,@Param("articleId") String articleId);

    //2.新增博客的相关文章链接
    void addBlogLinks(@Param("linkId") String LinkId,@Param("articleId") String articleId);


    //3.新增博客的分类
    void addBlogTags(@Param("tagId") String LinkId,@Param("articleId") String articleId);


    //4.新增博客记录
    void addArticle(BaseArticle baseArticle);

    //5.设置可见范围
    void addBlogVisibale (@Param("visibaleId") String LinkId,@Param("articleId") String articleId);



    //新增接口，用于暴露对外的接口，如文章查询
    //1.文章查询
    BaseArticle getArticleById(@Param("articleId") String articleId, @Param("language") String languge);
    //2.链接查询
    List<BlogLinks> getLinks(@Param("articleId") String articleId);
    //3.标签查询
    List<BlogTag> getTags(@Param("articleId") String articleId);
    //4.权限查询
    Integer getVisibility(@Param("articleId") String articleId);


    String getLinkTitle(@Param("linkId") String linkId);

    String getTagName(@Param("tagId") String tagId);




}
